<template>
  <div class="dashboard-container">
    <h2>工作台</h2>
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card shadow="hover" class="dashboard-card">
          <div slot="header" class="card-header">
            <span>今日订单</span>
          </div>
          <div class="card-content">
            <div class="card-value">{{ todayOrders }}</div>
            <div class="card-label">单</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover" class="dashboard-card">
          <div slot="header" class="card-header">
            <span>今日销售额</span>
          </div>
          <div class="card-content">
            <div class="card-value">{{ todaySales }}</div>
            <div class="card-label">元</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover" class="dashboard-card">
          <div slot="header" class="card-header">
            <span>待处理订单</span>
          </div>
          <div class="card-content">
            <div class="card-value">{{ pendingOrders }}</div>
            <div class="card-label">单</div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    
    <el-card class="chart-card" shadow="hover">
      <div slot="header" class="card-header">
        <span>近7日销售趋势</span>
      </div>
      <div class="chart-container">
        <!-- 这里可以放置图表组件 -->
        <div class="placeholder-chart">图表区域</div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'Dashboard',
  data() {
    return {
      // 模拟数据
      todayOrders: 32,
      todaySales: 3280.00,
      pendingOrders: 5
    }
  }
}
</script>

<style scoped>
.dashboard-container {
  padding: 20px;
}

.dashboard-card {
  margin-bottom: 20px;
  height: 180px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-content {
  display: flex;
  align-items: baseline;
  justify-content: center;
  height: 100px;
}

.card-value {
  font-size: 36px;
  font-weight: bold;
  color: #409EFF;
}

.card-label {
  font-size: 16px;
  margin-left: 5px;
  color: #606266;
}

.chart-card {
  margin-top: 20px;
}

.chart-container {
  height: 300px;
}

.placeholder-chart {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f7fa;
  color: #909399;
  font-size: 18px;
}
</style>